package org.itheima.dimen;

import android.os.Bundle;
import android.app.Activity;
import android.util.DisplayMetrics;
import android.view.Menu;

public class MainActivity extends Activity
{

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		//
		DisplayMetrics metrics = getResources().getDisplayMetrics();

		// 密度
		float density = metrics.density;

		// dpi
		int densityDpi = metrics.densityDpi;

		int widthPixels = metrics.widthPixels;
		int heightPixels = metrics.heightPixels;

		System.out.println(density + " : " + densityDpi);
		
		//px --》 dip 

	}

}
